// 统一管理用户相关接口
import request from '@/utils/request'
import type {
  LoginParams,
  LoginResultData,
  UserResultData,
  ErrorResultData,
} from './type'
// 统一管理接口
const API = {
  LOGIN_URL: '/user/login',
  USERINFO_URL: '/user/info',
} as const

// 登录接口
export const reqLogin = (data: LoginParams) =>
  request.post<ErrorResultData, LoginResultData>(API.LOGIN_URL, data)

// 获取用户信息接口
export const reqUserInfo = () =>
  request.get<ErrorResultData, UserResultData>(API.USERINFO_URL)
